using System;
namespace OLAActiveDirectory.Management
{
    public interface IADUserInfoShower
    {
        string GetInformation(IADUser objUser, string strSep);
    }
    public class ADUserInfoShower : IADUserInfoShower
    {
        private string prvInfoBuilder(IADUser objUser, string strSep)
        {
            string strResult;
            strResult = "Fullname:" + objUser["givenName"].Value + " " + objUser["sn"].Value;
            strResult += strSep + "Mail:" + objUser["mail"].Value;
            strResult += strSep + "Telephone(s):" + objUser["telephoneNumber"].Value;
            foreach (string strPhone in objUser["otherTelephone"])
                strResult += strSep + strPhone;
            return strResult;
        }
        public ADUserInfoShower()
        {
        }
        public string GetInformation(IADUser objUser, string strSep)
        {
            return this.prvInfoBuilder(objUser, strSep);
        }
    }
}

